import core.stdc.stdlib;
import std.stdio;

void main()
{
ubyte[] tp2;
{
@nogc
    auto p = malloc(10);
    ubyte[] uy = cast(ubyte[])(p[0..10]);
   auto tp = uy[0..2];
   tp2 = uy[3..5];
   free(tp.ptr);
   tp2[0] = 'a';
}
   writeln("tp2 = ", tp2);
}